public class Solution705 {

    boolean[] f=new boolean[1000001];

    public Solution705() {

    }

    public void add(int key) {
        f[key]=true;
    }

    public void remove(int key) {
        f[key]=false;
    }

    public boolean contains(int key) {
        return f[key];
    }

    public static void main(String[] args) {
        Solution705 solution705=new Solution705();
        solution705.add(1);
        solution705.add(2);
        System.out.println(solution705.contains(1));
        System.out.println(solution705.contains(3));
        solution705.add(2);
        System.out.println(solution705.contains(2));
        solution705.remove(2);
        System.out.println(solution705.contains(2));
    }
}
